var alasunList = {
    id:0,
    title:'天赋能',
    list:[
        {
            navTitle:'产业介绍',
            navEn:'Group Introduction',
            link:'rich-text.html'
        },{
            navTitle:'总裁寄语',
            navEn:'President\'s Speech',
            link:'rich-text.html'
        }
        ,{
            navTitle:'领导团队',
            navEn:'Leadership Team',
            link:'ldtd.html'
        }
        ,{
            navTitle:'企业文化',
            navEn:'Corporate Culture',
            link:'rich-text.html'
        }
        ,{
            navTitle:'资质资质',
            navEn:'Qualification',
            link:'zzry.html'
        }
    ]
}
alasunList.link = 'nav-page.html?nav='+alasunList.id;
var productLayout = {
    id:2,
    title:'产业布局',
    list:[
        {
            navTitle:'核心产品',
            navEn:'Business Area',
            link:'rich-text.html'
        },
        {
            navTitle:'运营中心',
            navEn:'Industrial Layout',
            link:'rich-text.html'
        }
    ]
};
productLayout.link = 'nav-page.html?nav='+productLayout.id;

var newsCenter = {
    id:1,
    title:'新闻中心',
    list:[
        {
            navTitle:'集团新闻',
            navEn:'Group News',
            link:'news-list.html'
        }
    ]
};
newsCenter.link = 'nav-page.html?nav='+newsCenter.id;

var expertTeam = {
    id:4,
    title:'科技发展',
    list:[
        {
            navTitle:'研发平台',
            navEn:'Scientific Research Institution',
            link:'keyanjigou.html'
        },
        {
            navTitle:'专家团队',
            navEn:'Expert of Platform',
            link:'expert-team.html'
        }
        // ,
        // {
        //     navTitle:'产研中心',
        //     navEn:'Production Research Center',
        //     link:'expert-team.html'
        // }
    ]
};
expertTeam.link = 'nav-page.html?nav='+expertTeam.id;

var socialResponsibility = {
    id:3,
    title:'社会责任',
    link:'nav-page.html?nav='+this.id,
    list:[
        // {
        //     navTitle:'公益捐助',
        //     navEn:'Public Donations',
        //     link:'rich-text.html'
                // },
        {
            navTitle:'健康推广基金',
            navEn:'',
            link:'rich-text.html'
        },
        {
            navTitle:'健康产业扶持',
            navEn:'',
            link:'rich-text.html'
        },
        {
            navTitle:'健康中国行',
            navEn:'Healthy China',
            link:'rich-text.html'
        },


        // ,
        // {
        //     navTitle:'携手伙伴',
        //     navEn:'Hand in Hand',
        //     link:'rich-text.html'
        // },
        // {
        //     navTitle:'创业帮扶',
        //     navEn:'Entrepreneurship Assistance',
        //     link:'rich-text.html'
        // }
    ]
}
socialResponsibility.link = 'nav-page.html?nav='+socialResponsibility.id;

var footerList = {
    id:6,
    name:'网站导航',
    en:'Website',
    link:'index.html',
    list:[
        {   id:20,
            name:'隐私政策',
            en:'Privacy policy',
            link:'rich-text.html'
        },
        {
            id:21,
            name:'法律声明',
            en:'Legal statement',
            link:'rich-text.html'
        }
    ]
}
mainList = [
    {
        id:1,
        name:'天赋能',
        en:'To Understand TianFuneng',
        link:'nav-page.html',
        list:[
            {
                id:1,
                name:'产业介绍',
                en:'Industry Introduction',
                link:'rich-text.html'
            },
            {
                id:2,
                name:'总裁寄语',
                en:'Speech',
                link:'rich-text.html'
            },
            {
                id:3,
                name:'领导团队',
                en:'Leadership',
                link:'ldtd.html'
            },
            {
                id:4,
                name:'企业文化',
                en:'Culture',
                link:'rich-text.html'
            },
            {
                id:5,
                name:'企业资质',
                en:'Qualification',
                link:'zzry.html'
            }

        ]
    },
    {
        id:2,
        name:'科技发展',
        en:'Technology Development',
        link:'nav-page.html',
        list:[
            {
                id:6,
                name:'研发平台',
                en:'R & D Platform',
                link:'keyanjigou.html'
            },
            {
                id:7,
                name:'产研基地',
                en:'Production Research Base',
                link:'rich-text.html'
            },
            {
                id:8,
                name:'研发专家学者',
                en:'R & D Experts',
                link:'expert-team.html'
            },
            {
                id:9,
                name:'医疗专家',
                en:'Medical Expert',
                link:'expert-team.html'
            },
            {
                id:10,
                name:'产研团队',
                en:'Production Research Team',
                link:'expert-team.html'
            }
        ]
    },
    {
        id:4,
        name:'新闻中心',
        en:'News Center',
        link:'news-list.html',
        list:[
            {
                id:14,
                name:'集团新闻',
                en:'Production Research Team',
                link:'expert-team.html'
            }
        ]
    },
    {
        id:3,
        name:'社会责任',
        en:'Responsibility',
        link:'nav-page.html',
        list:[
            {
                id:11,
                name:'健康推广基金',
                en:'Health Promotion Fund',
                link:'rich-text.html'
            },
            {
                id:12,
                name:'健康产业扶持',
                en:'Health Industry Support',
                link:'rich-text.html'
            },
            {
                id:13,
                name:'健康中国行',
                en:'Health of China',
                link:'rich-text.html'
            },
        ]
    }

]
let layoutMain = {
    id:5,
        name:'产业布局',
    en:'Product Layout',
    link:'nav-page.html',
    list:[

    ]
}
//获取社会责任
function getResponsibility(){
    sendAjaxAsync(global.url+'/Api/AdminWeb/get_shzr',function(res){
        for(let i in mainList){
            if(mainList[i].id == 3){
                mainList[i].list = res;
                for(let j in mainList[i].list){
                    mainList[i].list[j].link = 'rich-text.html';
                }
            }
        }


    })
}
getResponsibility();
//获取产业布局
function getProduct(){
    sendAjaxAsync(global.url+'/Api/New/get_cybj_class',function(res){
        layoutMain.list = res;
        for(let i in layoutMain.list){
            layoutMain.list[i].link = 'rich-text.html'
        }
        console.log(layoutMain.list);
    })
}
getProduct();
function setNavList(nav){
    var navList = {};
    switch (nav) {
        case alasunList.id:navList = alasunList
            break;
        case productLayout.id:navList = productLayout
            break;
        case newsCenter.id:navList = newsCenter
            break;
        case socialResponsibility.id:navList = socialResponsibility
            break;
        case expertTeam.id:navList = expertTeam
            break;

    }
    return navList
}



$().ready(function () {
    $('.logo').attr('src',global.indexLogo);
    var cilentHeight = window.screen.height;
    $('#fixed-body').css('height',cilentHeight+'px');
    $('.group-name').text(global.web_name);
    $('.group-address').text(global.address);
    $('.group-telephone').text(global.tele);
    $('#ewm').attr('src',global.erweima);
    var closeBtn = document.getElementById('closeNav');
    var openBtn = document.getElementById('openNav');
    var fixedBody = document.getElementById('fixed-body');
    openBtn.addEventListener('click',function(){
        // console.log(1);
        fixedBody.style.display = 'block';
        setTimeout(function(){
            fixedBody.style.opacity = 1;
        },100)
    })
    closeBtn.addEventListener('click',function(){
        fixedBody.style.opacity = 0;
        setTimeout(function(){
            fixedBody.style.display = 'none';
        },100)
    })

})
